<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="liguangdong">
<title>客户分级规则审核</title>
<script language="javascript" src="../script/common.js"
	type="text/javascript"></script>

<script language="javascript" type="text/javascript">

       var org = Common.cOrg();		  //当前单位
       var qt = {};				     //数据表格对象
	   var qt1 = {};
	   var qt2 = {};
       var operatorName=Common.cOperator().name;
       
       function load(){
	      
		   Eui.showNavigation();
	    
	 	   Common.initDict(search.status, "change_state", "全部");
	 	      //数据字典中的change_state中1,初始化2,等待审核3,审核通过 4,未审未通过
	 	   Common.initDict(crelistform1111.check_state, "check_state", "全部");   
	 	      //数据字典中的check_state中的1代表通过 2代表未通过
	 	   setPages(["listview","listview2","listview3"]);
	       createTable();
		  
		
		}
		
		function showData(){
           qt.showTable();
          }
    
		//生成表格，创建QueryTable对象   
		function createTable(){
			var columns =[];
		   //columns[1]={render:function(v){return v.format();}}
		   //columns[2]={render:function(v){return v.format();}}
			 columns[8]={title:"操作",width:"12%",align:"center",render:chakan,order:false}
			 columns[9]={title:"操作",width:"12%",align:"center",render:shenhe,order:false}
			 
			
			qt = new QueryTable("loy_gradeSchemeShenHe","search","datalist",columns);
			 
		}
		
		 function createTable1(){
			var columns=[];
			//columns[7]={title:"查看",width:"10%",render:updatesend2};
			//columns[8]={title:"操作",width:"10%",render:shanchuGFunc1};
			 qt1 = new QueryTable("loy_gradeRule","crelistform","datalist111",columns,{showData:"true",
					buttons:[
						
						{value:"返 回",actions:Cancel}
					]
				});
			qt1.showTable();
		}
    
      function createTable2(){
			var columns=[];
			//columns[7]={title:"查看",width:"10%",render:updatesend2};
			//columns[8]={title:"操作",width:"10%",render:shanchuGFunc1};
			 qt2 = new QueryTable("loy_gradeRule","crelistform1111","datalist1111",columns,{showData:"true",
					buttons:[
						{value:"确 定",actions:save},
						{value:"返 回",actions:Cancel}
					]
				});
			 qt2.showTable();
		}
		function save()
		
		 {
		      if(showQuestion("您确认审核吗?")==false){
			
				 return;
				
			    }
		  
		        alert($('crelistform1111').check_state.value);
		    	 DWR.call('gradeService.shenHeGradeScheme',$('crelistform1111').orderid.value,$('crelistform1111').check_state.value,function(t){
	     
			
			
				  createTable();
			   
		 		
		 		   switchPage('listview');
		 		   
		    	});	
		
		}
    
       function Cancel()
		{
			 createTable();
		     showData();
			 switchPage('listview');
		}
      function chakan(v,r)
      
      {
            return "<a href=# onclick=\"see('"+r[0]+"','"+r[1]+"','"+r[2]+"','"+r[3]+"','"+r[4]+"','"+r[5]+"','"+r[6]+"','"+r[7]+"','"+r[8]+"','"+r[9]+"');return false;\">查看审核</a>"
         
      }
      function see(id,code,startDate,endDate,flag,checker,checkerDate,comments)
      
      {
                    
              $("crelistform").orderid.value=id;
			  switchPage("listview2");
			 
			  $("actno").innerHTML=code;
			  $("gradeSchemeStartDate").innerHTML=startDate;
			  $("gradeSchemeEndDate").innerHTML=endDate;
			  $("ShenHeDate").innerHTML=checkerDate;
			  $("gradeSchemeFlag").innerHTML=flag;
			  $("sendoper").innerHTML=checker;
		     
		    //  $("gradeSchemeChecker").innerHTML=checker;
		     $("ShenHeComments").innerHTML=comments;
		     
		      createTable1();
		
      }
      
      function shenhe(v,r)
      
      {
          if(r[4]=="等待审核")
          {
               return "<a href=# onclick=\"shenhe111('"+r[0]+"','"+r[1]+"','"+r[2]+"','"+r[3]+"','"+r[4]+"','"+r[5]+"','"+r[6]+"','"+r[7]+"','"+r[8]+"','"+r[9]+"');return false;\">审核</a>"
          }
          else
          {
               return "<a href=# onclick=\><font color=\"gray\">审核</font></a>"
             
          }
         
      }
      function shenhe111(id,code,startDate,endDate,flag,checker,checkerDate)
      
        { 
                 
                  $("crelistform1111").orderid.value=id;
                  switchPage("listview3");
			 
			     $("actno1111").innerHTML=code;
			     $("gradeSchemeStartDate1111").innerHTML=startDate;
			     $("gradeSchemeEndDate1111").innerHTML=endDate;
			     $("ShenHeDate1111").innerHTML=checkerDate;
			     $("gradeSchemeFlag1111").innerHTML=flag;
			   
                 createTable2();   
                 
                
        }
</script>
</head>


<body onload="load()">
<!--页面导航-->
<div class="nav">
<div id="nav">&nbsp;</div>
</div>
<div id="content">
<div id="listview">
<div class="searchForm">
<form id="search" name="search"><input type=hidden id="orgn" name="orgn">
<table cellSpacing=0 cellPadding=4 width="100%" border=0>
	<tr>
		<td><label>审核状态</label> <select name="status"></select></td>
		<td>
		<button type="button" onclick="showData()">查 询</button>
		</td>
	</tr>
</table>
</form>
</div>
<div id=datalist></div>
</div>

</div>


<!--明细(新增)静态页面部分-->
<div id=listview2 style='display: none;' align=center>
<div class=form>
<form id="crelistform" name="crelistform"><input
	type=hidden id="orderid" name="orderid">

<div class="formTitle">等级计划信息</div>
<table cellSpacing=0 cellPadding=4 width="100%" border=0
	class="col3 label6">
	<tr>
		<td><label>等级计划编号</label> <span id="actno"></span></td>
		<td><label>等级状态</label> <span id="gradeSchemeFlag"></span></td>

	</tr>
	<tr>
		<td><label>等级开始日期</label> <span id="gradeSchemeStartDate"></span></td>
		<td><label>等级结束日期</label> <span id="gradeSchemeEndDate"></span></td>

	</tr>
	<tr>
		<td><label>审核日期</label> <span id="ShenHeDate"></span></td>
		<td><label>审核意见</label> <span id="ShenHeComments"></span></td>

	</tr>

	<tr>
		<td><label>审核人&nbsp;&nbsp;&nbsp;</label> <span id="sendoper"></span></td>

	</tr>
</table>

</form>
<div id="datalist111"></div>
</div>
</div>

<div id="listview3" style='display: none;' align=center>
<div class=form>
<form id="crelistform1111" name="crelistform1111"><input
	type=hidden id="orderid" name="orderid">

<div class="formTitle">等级计划审核</div>
<table cellSpacing=0 cellPadding=4 width="100%" border=0
	class="col3 label6">
	<tr>
		<td><label>等级计划编号</label> <span id="actno1111"></span></td>
		<td><label>等级状态</label> <span id="gradeSchemeFlag1111"></span></td>

	</tr>
	<tr>
		<td><label>等级开始日期</label> <span id="gradeSchemeStartDate1111"></span></td>
		<td><label>等级结束日期</label> <span id="gradeSchemeEndDate1111"></span></td>

	</tr>
	<tr>
		<td><label>审核日期</label> <span id="ShenHeDate1111"></span></td>
		<td><label>审核意见</label> <select name="check_state"></select>
	</tr>


</table>

</form>
<div id="datalist1111"></div>
</div>
</div>


</body>
</head>